<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>我的银行卡</title>
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="${resources}/css/common.css" type="text/css">
   	<link rel="stylesheet" href="${resources}/plugins/fontAwesome/4.6.3/css/font-awesome.min.css" type="text/css">
    <link rel="stylesheet" href="${resources}/css/myBankCar.css" type="text/css">
    <#include "setwxshare.ftl"/>
</head>
<body>
    <div id="container">
        <div class="my_backcar">
            <div class="title">
            <a href="javascript:history.go(-1);" class="back"><i class="fa fa-angle-left" aria-hidden="true"></i></a>
            <h3>我的银行卡</h3>
            </div>
            <!--银行卡信息-->
            <div class="bank_form">
                <p class="mes">请填写您本人的银行卡信息</p>
                <p><label>银行卡号</label></label><input type="text" maxlength="22"  id="bankcard"  value="${account.bankcard}"></p>
                <!-- 
                <p class="mes c_mes">建设银行储蓄卡</p>
                 -->
                <p><label>身份证号</label><input type="text" maxlength="18" id="identitycard" value="${account.identitycard}"></p>
                <p><label>手机号码</label><input type="text" maxlength="11" id="telephone" value="${account.telephone}"><!-- <i class="fa fa-times-circle" aria-hidden="true"></i> --></p>
                <button class="next">绑定</button>
            </div>
        </div>
    </div>
</body>

<script src="${resources}/plugins/jquery/2.2.2/jquery.min.js"></script>
<script src="${resources}/js/common.js"></script>
<script type="text/javascript">
$(function(){
	//提交订单
	$(".next").on("click",function(){
		var identitycard = $("#identitycard").val().trim();
		var bankcard = $("#bankcard").val().trim();
		var telephone = $("#telephone").val().trim();
		if(!bankcard){
			common.alert({content:"银行卡号不能为空"});
			return;	
		}
		if(!identitycard){
			common.alert({content:"身份证号不能为空"});
			return;	
		}
		if(!telephone){
			common.alert({content:"手机号码不能为空"});
			return;	
		}
    	$.ajax({
    		type:"post",
        	url:"${path}/manage/member/bankcard",
        	data:{
        		telephone:telephone,
        		identitycard:identitycard,
        		bankcard:bankcard
        	},
        	success:function(data){
        		if(data.code=='000'){
	        		common.alert({content:"身份绑定成功"});
	        		window.location.href="${path}/manage/member";
        		}else if(data.code='500'){
        			common.alert({content:"身份绑定已经成功，请勿重复提交"});
        		}else{
        			//510
		       		common.alert({content:"身份绑定失败"});
        		}
        	}
    	});
    	//---ajax end ---
    	
	});
})

</script>

</html>